package com.yangluyao.easyexcel.model;

import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

/*
* @Description: TODO
* @Author:  hejiayao
* @CreateDate:  2021/7/2 16:00
* @UpdateUser:  hejiayao
* @UpdateDate:  2021/7/2 16:00
* @className: EasyExcelModel
* @Package : com.yangluyao.easyexcel.model
* @Version: 1.0
*/
@Data
@NoArgsConstructor
@AllArgsConstructor
@EqualsAndHashCode
@TableName("easy_excel")
public class EasyExcelModel {

    @TableId(value = "id", type = IdType.AUTO)
    @ExcelIgnore  // 下载的Excel的表头中忽略此字段
    private Long id;

    @ExcelProperty(value = {"aa","姓名"}, index = 0)
    @TableField("name")
    private String name;

    @ExcelProperty(value = {"aa","年龄"}, index = 1)
    @TableField("age")
    private Integer age;

    @ExcelProperty(value = {" ","地址"}, index = 2)
    @TableField("address")
    private String address;

}
